//
//  CalendarRange.h
//  WebClipper
//
//  Created by Daniel Braun on 01/04/07.
//  Copyright 2007 Daniel Braun http://page-appart.net, http://braun.daniel.free.fr All rights reserved.
//
/*!
    @header CalendarRange
    @abstract   
    @discussion (c) Daniel Braun 2007
*/



#ifdef TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
/*!
    @class
    @abstract    a date interval
    @discussion  mostly 2 NSCalendarDate, and powerful initWithNaturalLangageString method
*/


@interface CalendarRange : NSObject {
	NSCalendarDate *date1;
	NSCalendarDate *date2;
}

- (NSString *) description;

/*!
    @method     
    @abstract   returns begin of date interval
    @discussion
*/
- (NSCalendarDate *) date1;

/*!
    @method     
    @abstract   set begin of date interval
*/
- (void) setDate1:(NSCalendarDate*)d1;

/*!
    @method     
    @abstract   returns end of date interval
    @discussion
*/
- (NSCalendarDate *) date2;

/*!
    @method     
    @abstract   returns end of date interval
    @discussion
 */
- (BOOL) containDate:(NSCalendarDate *)date;


/*!
    @method     
    @abstract   set end of date interval
    @discussion 
*/
- (void) setDate2:(NSCalendarDate*)d2;

- (id) initWithCoder:(NSCoder *) coder;
- (void)encodeWithCoder:(NSCoder *) coder;

/*!
    @method     
    @abstract   init with natural language string
    @discussion e.g. with "23 avr.. 3 sept 2008"
*/
- (id) initWithNaturalLangageString:(NSString *)s;

/*!
    @method     
    @abstract   create a CalendarRange with a natural language string
    @discussion 
*/
+ (id) calendarRangeWithNaturalLangageString:(NSString *)s;

- (NSString *) shortString;
@end

@interface NSCalendarDate (shortstring)
- (NSString *) shortString;
@end
